home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / propage / donsgenies / donsgenies.lha / Don'sGenies / GridFromBox.pprx < prev    next >
Text File  |  1992-08-13  |  1KB  |  53 lines

  1. /* This Genie sets up a grid to match a box, with snap enabled.
  2. Written by Don Cox  © August 92*/
  3.  
  4.  
  5. signal on error
  6. signal on syntax
  7. address command
  8. call SafeEndEdit.rexx()
  9. call ppm_AutoUpdate(0)
  10. cr="0a"x
  11.  
  12. currentunits = ppm_GetUnits()
  13. box     = ppm_ClickOnBox("  Click on box for grid size.")
  14. if box  = 0 then exit_msg("No box selected")
  15. gsize = ppm_GetGridSize()
  16. gwidth = word(gsize,1)
  17. gheight = word(gsize,2)
  18. size = ppm_GetBoxSize(box)
  19. width = word(size,1)
  20. height = word(size,2)
  21. choice = ppm_Inform(3,"Set Grid size to match box...","Width","Height","Both")
  22. select
  23.     when choice = 0 then call ppm_SetGridSize(width,gheight)
  24.     when choice = 1 then call ppm_SetGridSize(gwidth,height)
  25.     otherwise call ppm_SetGridSize(width,height)
  26.     end
  27.  
  28.  
  29. call ppm_SetGrid(1)
  30.  
  31. call ppm_SetGridSnap(1)
  32.  
  33. call exit_msg()
  34.  
  35. end
  36.  
  37. error:
  38. syntax:
  39.     do
  40.     exit_msg("Genie failed due to error: "errortext(rc))
  41.     end
  42.  
  43. exit_msg:
  44.     do
  45.     parse arg message
  46.     if message ~= "" then
  47.     call ppm_Inform(1,message)
  48.     call ppm_ClearStatus()
  49.     call ppm_AutoUpdate(1)
  50.     exit
  51.     end
  52.  
  53.